# %% Logical Operator

# object reference
a = [1, 2, 3]
b = [1, 2, 3]

print('a == b:', a == b)
print('a is b:', a is b)

# None is unknown or nonexistent
a = 'something'
b = None
print('a is not None:', a is not None)
print('b is None:', b is None)

# compare operator 
print('3 <= 5 <= 6:', 3 <= 5 <= 6)

# %% exception handling
s = input('enter an interger:')
try:
    i = int(s)
    print('valid integer entered:', i)
except ValueError as err:
    print(err)

# %% arithmetic operator
# int value is fixed, and all variables quote its value 


# a += 8 is faster than a = a + 8 
# because the latter quiry the value of a twice, and the former once.

# overload
name = 'John'
name_1 = name + 'Doe'
name += 'Doe'
print('name_1:',name_1, '; name:', name)
seeds = ['ab', 'cd']
seeds += ['ef']
# list += xx : xx must be a iterable
seeds += [5]
print(seeds)
seeds += [5,23,324,'qweq']
print(seeds)
seeds.append('string-nolist')
print(seeds)
seeds += 'string-nolist'
print(seeds)